package cn.tedu.design;

/**
 * @Author 金帮嘉诚
 * @Date 2021-06-11 周五 16:00
 */
/*本类用于设计老师类，要求：面向抽象编程--后天抽象形成的结果 通过提取共性方法、属性*/
public class DesignTeacher1 {
    public static void main(String[] args) {
        CGBTeacher ct = new CGBTeacher();
        ct.ready();
        ct.teach();
        ACTTeacher actTeacher = new ACTTeacher();
        actTeacher.ready();
        actTeacher.teach();
    }
}
//
abstract class Teacher1 {
    int id;
    String name;
    //子类一定会重写的方法，没必要写方法体
    public abstract void ready();
    public abstract void teach();
}
//培优老师类
class CGBTeacher extends Teacher1 {
    @Override
    public void ready() {
        System.out.println("正在备课...培优");
    }
    @Override
    public void teach() {
        System.out.println("正在讲课...培优");
    }
}
//高手老师类
class ACTTeacher extends Teacher1 {
    @Override
    public void ready() {
        System.out.println("正在备课...加强模块");
    }
    @Override
    public void teach() {
        System.out.println("正在讲课...加强模块");
    }
}
//大数据老师类
class SCDTeacher extends Teacher1 {//冗余
    @Override
    public void ready() {
        System.out.println("正在备课...hadoop");
    }
    @Override
    public void teach() {
        System.out.println("正在讲课...hadoop");
    }
}
